<template>
  <view class="OrderAddress">
    <view class="formView">
      <view class="form">
        <u-field
          v-model="userInfo.name"
          label="账户姓名："
          placeholder="请输入"
          input-align="right"
          disabled
          label-width="200rpx"
          type="textarea"
          :clearable="false"></u-field>
        <u-field
          v-model="userInfo.id"
          type="number"
          disabled
          label="账户ID"
          placeholder="请输入"
          input-align="right"
          :clearable="false"
        >
        </u-field>
        <u-field label="充值金额" disabled :border-bottom="false">
        </u-field>
        <u-field label="¥" label-width="40" v-model="money">
        </u-field>
      </view>
      <view class="buttonDiv" @click="handleSubmit"> 充值 </view>
    </view>

    <u-toast ref="uToast" />
  </view>
</template>
<script>
import { applyRecharge } from '@/api/account.js';
export default {
  name: 'OrderAddress',
  components: {},
  props: {},
  data() {
    return {
      id: '',
      mobile: '',
      name: '',
      money: ''
    };
  },
  computed: {
    userInfo: {
      get() {
        return this.$store.getters.userInfo;
      },
      set() {
      }
    }
  },
  methods: {
    // getImgUrls(url) {
    //   // const urls = url.split(',');
    //   // console.log('imgUrls5', urls);
    //   // const newUrl = urls.map((item) => {
    //   //   return process.env.VUE_APP_UPLOAD_URL + item;
    //   // });
    //   // console.log('urls', newUrl);
    //   this.imgUrls = url;
    //   // console.log('imgUrls5656', this.imgUrls);
    // },
    handleSubmit() {
      console.log('this.imgUrls', this.imgUrls);
      if (!this.money) {
        this.$refs.uToast.show({
          title: !this.money
            ? '请输入金额'
            : '',
          duration: '2300'
        });
        return;
      }
      const pd = {
        merchantId: this.userInfo.id,
        money: this.money
      };
      applyRecharge(pd).then(() => {
      });
    }
  },
  watch: {},
  // 页面周期函数--监听页面加载
  onLoad() {
  },
  // 页面周期函数--监听页面初次渲染完成
  onReady() {},
  // 页面周期函数--监听页面显示(not-nvue)
  onShow() {},
  // 页面周期函数--监听页面隐藏
  onHide() {},
  // 页面周期函数--监听页面卸载
  onUnload() {}
  // 页面处理函数--监听用户下拉动作
  // onPullDownRefresh() { uni.stopPullDownRefresh(); },
  // 页面处理函数--监听用户上拉触底
  // onReachBottom() {},
  // 页面处理函数--监听页面滚动(not-nvue)
  // onPageScroll(event) {},
  // 页面处理函数--用户点击右上角分享
  // onShareAppMessage(options) {},
};
</script>

<style lang="scss" scoped>
.OrderAddress {
  padding: 28rpx 32rpx 0;
  background: #f7f8f9;
  min-height: 100vh;
  @import './index.scss';
}
.fileImage{
  width: 192rpx;
  height:192rpx
}
</style>
